<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性</title>
    <script src="vue.js"></script>
    <script src="axios.min.js"></script>
</head>

<body>
    <div id="app">
        <div>
            <h1 style="background-color: chartreuse;">{{msg}}</h1>
            <h1 style="background-color:cyan;">{{reversemessage}}</h1>
            信息： <input type="text" placeholder="请输入信息" v-model="msg">

            <button @click="change">改变信息</button>
        </div>
    </div>
</body>

</html>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            msg: "helloworld"
        },
        computed: {
            reversemessage() {
                return this.msg.split("").reverse().join("");
            }
        },
        methods: {
            change() {
                this.msg = "woniuxy";
            }
        },
    });
</script>